package com.goldgov.code.meta;

import java.util.Date;

public enum FieldType {

	VARCHAR(String.class,"VARCHAR"),
	VARCHAR2(String.class,"VARCHAR"),
	CHAR(String.class,"CHAR"),
	INTEGER(Integer.class,"INTEGER"),
	INT(Integer.class,"INTEGER"),
	TINYINT(Integer.class,"INTEGER"),
	BIGINT(Long.class,"BIGINT"),
	NUMBER(Integer.class,"NUMERIC"),
	NUMERIC(Integer.class,"NUMERIC"),
	DATE(Date.class,"DATE"),
	DATETIME(Date.class,"TIMESTAMP"),
	TIMESTAMP(Date.class,"TIMESTAMP"),
	DOUBLE(Double.class,"DOUBLE"),
	DECIMAL(Double.class,"DECIMAL"),
	FLOAT(Double.class,"FLOAT"),
	CLOB(char[].class,"CLOB"),
	BLOB(byte[].class,"BLOB");
	
	private final Class<?> javaType;
	
	private final String jdbcType;

	private FieldType(Class<?> javaType,String jdbcType) {
		this.javaType = javaType;
		this.jdbcType = jdbcType;
	}

	public Class<?> getJavaType() {
		return javaType;
	}
	
	public String getSimpleJavaType() {
		return javaType.getSimpleName();
	}

	public String getJdbcType() {
		return jdbcType;
	}
	

}
